package br.edu.ufcg.dsc.actions.reservation;

import java.util.List;

import org.apache.struts2.config.ParentPackage;
import org.apache.struts2.config.Result;
import org.apache.struts2.dispatcher.ServletDispatcherResult;

import br.edu.ufcg.dsc.actions.BaseLoggedAction;
import br.edu.ufcg.dsc.domain.Reservation;
import br.edu.ufcg.dsc.services.ReservationService;

@Result(name = "success", type = ServletDispatcherResult.class, value = "/jsp/reservation/reservationDetails.jsp")
@ParentPackage("myPackage")
public class FindReservationAction extends BaseLoggedAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private List<Reservation> reservations;
	
	@Override
	protected String executeIfLogged() {
		reservations = ReservationService.findAllReservations();
		return SUCCESS;
	}

	public List<Reservation> getReservations() {
		return reservations;
	}

	public void setReservations(List<Reservation> reservations) {
		this.reservations = reservations;
	}
	
}
